/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nodeLevelMetaModel.util;

import java.util.List;

import nodeLevelMetaModel.*;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see nodeLevelMetaModel.NodeLevelMetaModelPackage
 * @generated
 */
public class NodeLevelMetaModelSwitch<T> {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static NodeLevelMetaModelPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NodeLevelMetaModelSwitch() {
		if (modelPackage == null) {
			modelPackage = NodeLevelMetaModelPackage.eINSTANCE;
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	public T doSwitch(EObject theEObject) {
		return doSwitch(theEObject.eClass(), theEObject);
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(EClass theEClass, EObject theEObject) {
		if (theEClass.eContainer() == modelPackage) {
			return doSwitch(theEClass.getClassifierID(), theEObject);
		}
		else {
			List<EClass> eSuperTypes = theEClass.getESuperTypes();
			return
				eSuperTypes.isEmpty() ?
					defaultCase(theEObject) :
					doSwitch(eSuperTypes.get(0), theEObject);
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case NodeLevelMetaModelPackage.NODE: {
				Node node = (Node)theEObject;
				T result = caseNode(node);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.ROLE: {
				Role role = (Role)theEObject;
				T result = caseRole(role);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.LEADER_ROLE: {
				LeaderRole leaderRole = (LeaderRole)theEObject;
				T result = caseLeaderRole(leaderRole);
				if (result == null) result = caseRole(leaderRole);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.BASE_STATION_ROLE: {
				BaseStationRole baseStationRole = (BaseStationRole)theEObject;
				T result = caseBaseStationRole(baseStationRole);
				if (result == null) result = caseRole(baseStationRole);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.MEMBER_ROLE: {
				MemberRole memberRole = (MemberRole)theEObject;
				T result = caseMemberRole(memberRole);
				if (result == null) result = caseRole(memberRole);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.OPERATIONAL_TASK: {
				OperationalTask operationalTask = (OperationalTask)theEObject;
				T result = caseOperationalTask(operationalTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.RECEIVING_TASK: {
				ReceivingTask receivingTask = (ReceivingTask)theEObject;
				T result = caseReceivingTask(receivingTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.SENDING_TASK: {
				SendingTask sendingTask = (SendingTask)theEObject;
				T result = caseSendingTask(sendingTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.SAMPLING_TASK: {
				SamplingTask samplingTask = (SamplingTask)theEObject;
				T result = caseSamplingTask(samplingTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.AGGREGATION_TASK: {
				AggregationTask aggregationTask = (AggregationTask)theEObject;
				T result = caseAggregationTask(aggregationTask);
				if (result == null) result = caseOperationalTask(aggregationTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.FUSION_TASK: {
				FusionTask fusionTask = (FusionTask)theEObject;
				T result = caseFusionTask(fusionTask);
				if (result == null) result = caseOperationalTask(fusionTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.SPATIAL_AGGREGATION_TASK: {
				SpatialAggregationTask spatialAggregationTask = (SpatialAggregationTask)theEObject;
				T result = caseSpatialAggregationTask(spatialAggregationTask);
				if (result == null) result = caseAggregationTask(spatialAggregationTask);
				if (result == null) result = caseOperationalTask(spatialAggregationTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case NodeLevelMetaModelPackage.TEMPORAL_AGGREGATION_TASK: {
				TemporalAggregationTask temporalAggregationTask = (TemporalAggregationTask)theEObject;
				T result = caseTemporalAggregationTask(temporalAggregationTask);
				if (result == null) result = caseAggregationTask(temporalAggregationTask);
				if (result == null) result = caseOperationalTask(temporalAggregationTask);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Node</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Node</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseNode(Node object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Role</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Role</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseRole(Role object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Leader Role</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Leader Role</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseLeaderRole(LeaderRole object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Base Station Role</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Base Station Role</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBaseStationRole(BaseStationRole object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Member Role</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Member Role</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseMemberRole(MemberRole object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Operational Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Operational Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseOperationalTask(OperationalTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Receiving Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Receiving Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseReceivingTask(ReceivingTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Sending Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Sending Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSendingTask(SendingTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Sampling Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Sampling Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSamplingTask(SamplingTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Aggregation Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Aggregation Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseAggregationTask(AggregationTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Fusion Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Fusion Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseFusionTask(FusionTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Spatial Aggregation Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Spatial Aggregation Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseSpatialAggregationTask(SpatialAggregationTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Temporal Aggregation Task</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Temporal Aggregation Task</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTemporalAggregationTask(TemporalAggregationTask object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	public T defaultCase(EObject object) {
		return null;
	}

} //NodeLevelMetaModelSwitch
